<!--
 * @Author: caofujun
 * @Date: 2020-10-12 10:07:18
 * @Description:
-->
<template>
    <div>
        <el-button @click="chooseDateTime">导出</el-button>
        <el-button @click="qrcode">生成二维码</el-button>
    </div>
</template>

<script>
import { exportZip, createKeysQrCode } from '@/utils/zip'
export default {
    name: 'Test',
    components: {},
    data() {
        return {
            keyList: ['1111111', '2222222', '3333'],
            ZipFiles: [
                {
                    folderName: 'QrCode',
                    files: [],
                    needFolder: true
                }
            ]
        }
    },
    mounted() { },
    methods: {
        qrcode() {
            createKeysQrCode(this.keyList)
                .then(res => {
                    this.ZipFiles[0].files = res
                })
                .catch(e => {
                    console.error(e)
                })
        },
        chooseDateTime(val) {
            exportZip(this.ZipFiles, '200000')
        }
    }
}
</script>
